package com.itheima.tlais_web_management.mapper;

import com.itheima.tlais_web_management.pojo.Goods;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface GoodsMapper {

    @Delete("delete from tlias.goods where id = #{id}")
    public void deletegoods(Integer id);

    @Insert("insert into tlias.goods(name, price) values (#{name},#{price})")
    public void add(@Param("name") String name, @Param("price") Integer price);

    @Update("update tlias.goods set price = #{price} where tlias.goods.id = #{id}")
    public void delete (@Param("id") Integer id,@Param("price") Integer price);

    @Select("select * from tlias.goods")
    public List<Goods> list();

}
